package com.comac.print.component.app.controller;

import com.alibaba.cola.dto.Response;
import com.comac.print.component.app.api.MasterPlateService;
import com.comac.print.component.app.api.SystemService;
import com.comac.print.component.app.cmd.MasterPlateCmd;
import com.comac.print.component.app.cmd.SystemCmd;
import com.comac.print.component.app.dto.MasterPlateDTO;
import com.comac.print.component.app.dto.SystemDTO;
import com.comac.print.component.app.page.PageResponse;
import com.comac.print.component.app.qry.MasterPlateListQry;
import com.comac.print.component.app.qry.SystemListQry;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.validation.constraints.NotNull;

/**
 * @Description 系统控制器
 * @Author yy
 * @Date 2022/4/13 17:35
 */
@Api("系统控制器")
@RestController
@Slf4j
public class SystemController {

    @Autowired
    private SystemService systemService;


    @ApiOperation(value = "系统信息创建")
    @PostMapping(value = "/system/save")
    public Response systemCreate(@RequestBody SystemCmd systemCmd) {
        return systemService.saveSystemInformation(systemCmd);
    }


    @ApiOperation(value = "系统信息列表")
    @PostMapping(value = "/system/list")
    public PageResponse<SystemDTO> masterPlateListQry(@RequestBody SystemListQry systemListQry) {
        return systemService.qrySystemList(systemListQry);
    }

    @ApiOperation(value = "系统信息删除")
    @PostMapping(value = "/system/delete")
    public Response systemDelete(@RequestBody SystemCmd systemCmd) {
        return systemService.systemDelete(systemCmd);
    }

}
